package cn.gailvlun.gll.net.apartment.room;



public enum RoomStatus {
    UN_REVIEW(0, "待审核"),
    WAITING_OPEN(1, "等待开房"),
    OPENING(2, "开启中"),
    END(3, "已结束"),
    ABORT(4, "已取消"),
    DISMISS(5, "解散"),
    CANCEL(6, "取消"),
    REVIEW_PASS(7, "审核通过"),
    REVIEW_OBJECTION(8, "审核驳回"),
    SIGNING(9, "报名中"),
    SIGNING_COMPLETE(10, "报名结束"),
    WAITING_FOR_SIGNING(11, "已上线");

    private int order;
    private String title;

    RoomStatus(int order, String title) {
        this.order = order;
        this.title = title;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isPublished() {
        switch (order) {
            case 0:
            case 7:
            case 8:
                return false;
            default:
                return true;
        }
    }

    public boolean isDisplaySignDate() {
        switch (order) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 9:
            case 10:
            case 11:
                return true;
            default:
                return false;
        }
    }

    public static RoomStatus getByOrder(int order) {
        for (RoomStatus roomStatus : values()) {
            if (order == roomStatus.order) {
                return roomStatus;
            }
        }
        return null;
    }
}
